#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "menu.h"
#include "Timer.h"
#include "Key.h"
#include "StopClock.h"
#include "game_dino.h"


int main(void)
{
	/*OLED初始化*/
	OLED_Init();
	
	/*菜单外设初始化*/
	Peripheral_Init();
	Timer_Init();
	/*标志位*/
	uint8_t clkflag1;
	
	
	while (1)
	{
		clkflag1=Show_Clock_First();
		if(clkflag1==1){Show_Menu_UI();}
		else if(clkflag1==2){Show_Setting_Detail();}
	}
}

 //定时器中断函数，可以复制到使用它的地方
void TIM2_IRQHandler(void)
{
	if (TIM_GetITStatus(TIM2, TIM_IT_Update) == SET)
	{
		StopClock_Tick();
		Key_Tick();
		Dino_Tick();
		TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
	}
}

